package com.dz.xjd.ui.activity;

import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.dz.xjd.R;
import com.dz.xjd.ui.base.BaseActivity;
import com.dz.xjd.utils.ToastUtil;
import butterknife.BindView;
import butterknife.OnClick;

public class PhoneCertificationActivity extends BaseActivity {


    @BindView(R.id.et_certifi_username)
    EditText mEtUsername;

    @BindView(R.id.et_certifi_password)
    EditText mEtPassword;

/*    @BindView(R.id.btn_certifi_validate)
    Button mBtnValidate;*/

    @BindView(R.id.btn_certifi_next)
    Button mBtnNext;

 /*   @BindView(R.id.cb_certifi_read)
    CheckBox mCbRead;*/


    private String username;
    private String password;

    @Override
    protected int getLayout() {
        return R.layout.activity_phone_certification;
    }

    @Override
    protected void init() {
        /*mCbRead.setOnCheckedChangeListener(mOnCheckedChangeListener);*/
    }

    @Override
    public void initPresenter() {

    }
    @OnClick(R.id.btn_certifi_next)
    void onClick(View v) {
        switch (v.getId()){
            case R.id.btn_certifi_next :
                validateSubmit();
                break;
        }

    }

    private void validateSubmit() {

    }

    private void nextSubmit() {
        if(verifyLoginInfo()){
            /*mPresenter.getLoginRequest(username, password);*/
        }

    }

    private boolean verifyLoginInfo() {
        username = mEtUsername.getText().toString().trim();
        password = mEtPassword.getText().toString().trim();
        if(TextUtils.isEmpty(username)){
            ToastUtil.showShort("请输入用户名");
            return false;
        }
        if(TextUtils.isEmpty(password)){
            ToastUtil.showShort("请输入密码");
            return false;
        }

        return true;
    }

    /*private CompoundButton.OnCheckedChangeListener mOnCheckedChangeListener = new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if(isChecked){
                mBtnNext.setEnabled(true);
            }else{
                mBtnNext.setEnabled(false);
            }
        }
    };*/
}
